﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using CafeApp.ViewModel;

namespace CafeApp.Service
{
    public class DM_BAN_SERVICE
    {
        RESMANEntities db = new RESMANEntities();

        public List<DMBAN> GetListByDay(int maday)
        {
            try
            {
                var c = from i in db.DMBANs where i.MADAY.Value == maday select i;
                return c.ToList();
            }
            catch
            {
                return null;
            }
        }

        public DMBAN GetById(string id)
        {
            try
            {
                var c = from i in db.DMBANs where i.MABAN == id select i;
                return c.First();
            }
            catch
            {
                return null;
            }
        }
    }
}